cmake_minimum_required(VERSION 3.7)
PROJECT(lua)

include_directories(
./
)

set(CORE_SRCS 
lapi.c
lcode.c 
lctype.c 
ldebug.c 
ldo.c 
ldump.c 
lfunc.c 
lgc.c 
llex.c 
lmem.c 
lobject.c 
lopcodes.c 
lparser.c 
lstate.c 
lstring.c 
ltable.c 
ltm.c 
lundump.c 
lvm.c 
lzio.c
lauxlib.c 
lbaselib.c 
lbitlib.c 
lcorolib.c 
ldblib.c 
liolib.c 
lmathlib.c 
loslib.c 
lstrlib.c 
ltablib.c 
lutf8lib.c 
loadlib.c 
linit.c
)

add_library(lua
${CORE_SRCS} 
)

add_executable(jks lua.c)
target_link_libraries(jks lua m)

add_executable(jksc luac.c)
target_link_libraries(jksc lua m)

ADD_TEST(luatest
SOURCES test/luatest.cpp
LIBRARIES lua gtest_main
)